package com.design.patterns.structuralModel.strategy.service.strategy;

import com.design.patterns.structuralModel.strategy.service.strategy.DiscountStrategy;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class UserDiscountStrategy implements DiscountStrategy {
    @Override
    public BigDecimal getDiscount(BigDecimal total) {
        //九折
        return total.multiply(new BigDecimal("0.1")).setScale(2, RoundingMode.DOWN);
    }
}
